package indi.zhifa.expshare.class001.chemicalmatch.util.openai.embding.entity;

import lombok.Data;

import java.util.List;

@Data
public class GPTEmbeddingResponse {
    String object;
    List<RspData> data;
    String model;
    Usage usage;

    @Data
    public class RspData {
        String object;
        int index;
        List<Double> embedding;
    }

    @Data
    public class Usage{
        int prompt_tokens;
        int total_tokens;
    }

    public List<Double> getVector(){
        if(data!=null&& data.size()>0){
            return data.get(0).embedding;
        }else{
            return null;
        }
    }

}
